<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        .nodeSmall {
            width: 50px;
            height: 50px;
            background: url(images/bgs.png) no-repeat -159px -51px;
            position: fixed;
            right: 10px;
            top: 40%;
        }

        .erweima {
            position: absolute;
            top: 0;
            left: -150px;
        }

        .nodeSmall a {
            display: block;
            width: 50px;
            height: 50px;
        }

        .hide {
            display: none;
        }

        .show {
            display: block;
        }
    </style>
</head>
<body>
<div class="nodeSmall" id="node_small">
    <a href="#"></a>

    <div class="erweima hide" id="er">
        <img src="images/456.png" alt=""/>
    </div>
</div>
<script>
    //找人
    var node = document.getElementById("node_small");
    var er = document.getElementById("er");
    //鼠标经过父盒子 让二维码显示 onmouseover 鼠标经过事件
    node.onmouseover = function () {
        //er.className = "erweima show";
        //让二维码显示 把hide替换成show
        er.className = er.className.replace("hide", "show");
    };
    //鼠标离开父盒子 让二维码隐藏 onmouseout 鼠标离开事件
    node.onmouseout = function () {
        //er.className = "erweima hide";
        //让二维码隐藏 把show替换成hide
        er.className = er.className.replace("show", "hide");
    };

    var str = "aa bb cc erweima show";
     console.log(str);
     str = str.replace("show", "hide");
     console.log(str);



</script>
</body>
</html>